package com.gaohe.hotal.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.hotal.mapper.HotRoomMapper;
import com.gaohe.hotal.domain.HotRoom;
import com.gaohe.hotal.service.IHotRoomService;

/**
 * 房间Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-02
 */
@Service
public class HotRoomServiceImpl implements IHotRoomService 
{
    @Autowired
    private HotRoomMapper hotRoomMapper;

    /**
     * 查询房间
     * 
     * @param roomId 房间主键
     * @return 房间
     */
    @Override
    public HotRoom selectHotRoomByRoomId(Long roomId)
    {
        return hotRoomMapper.selectHotRoomByRoomId(roomId);
    }

    /**
     * 查询房间列表
     * 
     * @param hotRoom 房间
     * @return 房间
     */
    @Override
    public List<HotRoom> selectHotRoomList(HotRoom hotRoom)
    {
        return hotRoomMapper.selectHotRoomList(hotRoom);
    }

    /**
     * 新增房间
     * 
     * @param hotRoom 房间
     * @return 结果
     */
    @Override
    public int insertHotRoom(HotRoom hotRoom)
    {
        hotRoom.setCreateTime(DateUtils.getNowDate());
        return hotRoomMapper.insertHotRoom(hotRoom);
    }

    /**
     * 修改房间
     * 
     * @param hotRoom 房间
     * @return 结果
     */
    @Override
    public int updateHotRoom(HotRoom hotRoom)
    {
        hotRoom.setUpdateTime(DateUtils.getNowDate());
        return hotRoomMapper.updateHotRoom(hotRoom);
    }

    /**
     * 批量删除房间
     * 
     * @param roomIds 需要删除的房间主键
     * @return 结果
     */
    @Override
    public int deleteHotRoomByRoomIds(Long[] roomIds)
    {
        return hotRoomMapper.deleteHotRoomByRoomIds(roomIds);
    }

    /**
     * 删除房间信息
     * 
     * @param roomId 房间主键
     * @return 结果
     */
    @Override
    public int deleteHotRoomByRoomId(Long roomId)
    {
        return hotRoomMapper.deleteHotRoomByRoomId(roomId);
    }
}
